package com.ruoyi.demo.pojo.dto;

import java.util.List;

public class PageResult<T> {
    public static final int SUCCESS_CODE = 200;
    public static final int FAIL_CODE = 0;
    public static final int ERROR_CODE = 500;

    public static final String SUCCESS_MSG = "操作成功";
    public static final String FAIL_MSG = "操作失败";
    public static final String ERROR_MSG = "操作异常";

    public PageResult(){}
    public PageResult(List<T> list,Long total){
        this.total=total;
        this.list=list;
    }

    private List<T> list;
    private long total;

    private int code=SUCCESS_CODE;
    private String msg=SUCCESS_MSG;

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
